#include <iostream>

int main()
{
    using namespace std;  //introduces namespace std
    int rows;
    int row;
    int col;
    int periods;
    
    cout << "Enter number of rows: ";
    cin >> rows;
    
    for (row = 1; row <= rows; row++)
    {
        periods = rows - row;
        for (col = 1; col <= periods; col++)
            cout << '.';
        // col already has correct value for next loop
        for (   ; col <= rows; col++)
            cout << '*';
        cout << endl;
    }
    
    return 0;
}
